<%--
  ~ Copyright (c) 2009.
  ~ nick@tmro.net
  --%>
<!--
Created by IntelliJ IDEA.
User: nick
Date: Apr 5, 2009
Time: 10:01:23 PM
To change this template use File | Settings | File Templates.
-->
<%@page contentType="text/html" %>
<%@page pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Category List</title>
</head>
<body>
<f:view>
    <h1>Category List</h1>
    <h:form>
        <h:commandButton action="#{category.startCreate}" value="Create"/>

        <h:dataTable value='#{category.allEntities}' var='item' border="1" cellpadding="2" cellspacing="0">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="name"/>
                </f:facet>
                <h:outputText value="#{item.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="version"/>
                </f:facet>
                <h:outputText value="#{item.version}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="dateCreated"/>
                </f:facet>
                <h:outputText value="#{item.dateCreated}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="dateModified"/>
                </f:facet>
                <h:outputText value="#{item.dateModified}"/>
            </h:column>
            <h:column>
                <h:commandButton value="View" action="#{category.startView}">
                    <f:param name="id" value="#{item.id}"/>
                </h:commandButton>&nbsp;
                <h:commandButton value="Edit" action="#{category.startEdit}">
                    <f:param name="id" value="#{item.id}"/>
                </h:commandButton>&nbsp;
                <h:commandButton value="Delete" action="#{category.delete}">
                    <f:param name="id" value="#{item.id}"/>
                </h:commandButton>
            </h:column>
        </h:dataTable>
    </h:form>
</f:view>
</body>
</html>
